﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace DesignPattrn.DesignPatten
{
    class Delegate
    {
        #region Private members
        static private int _globalCount = 0;
        #endregion
        public delegate void ThreadCountChangedEventHandler(object sander, EventArgs e);
        public static event ThreadCountChangedEventHandler ThreadCountChanged;

        public static int GlobalCount
        {
            get
            {
                return _globalCount;
            }
            set
            {
                _globalCount = value;
                if (ThreadCountChanged != null)
                {
                    ThreadCountChanged(_globalCount, new EventArgs());
                }
            }
        }
    }
}
